// Sami2Srt.h: interface for the CSami2Srt class.
//
//////////////////////////////////////////////////////////////////////

#pragma once

class CSami2Srt
{
protected:
	CString csExtractCC(TCHAR *tc, long lFrom, long lTo);
	DWORD dwExtractTime(TCHAR *tc, long lFrom, long lTo);
	bool bNextTag(TCHAR *tc, long lLen, long lStart, long &lFrom, long &lTo);
	bool bNextSYNC(TCHAR *tc, long lLen, long lStart, long &lFrom, long &lTo);
	bool bNextP(TCHAR *tc, long lLen, long lStart, long &lFrom, long &lTo);
	long lFinalTag(TCHAR *tc, long lLen, long lStart=0);
	TCHAR * tcSubRipText(CStringArray &csaSub);
	bool bGetNextTag(TCHAR *tBuf, long lLen, long lBegin, long &lFrom, long &lTo, CString &csTag);
	CString csFixSubs(TCHAR *tSami, long lFrom, long lTo);
	int iGetCCNo(CStringArray &csa, CString &cs);
	void InsertSubWTime(CStringArray &csa, CString &csSubTime);

public:
	int findInCStringArray(CStringArray &csa, LPCTSTR lp);
	void tcscpyWOzero(TCHAR *tcDst, long &lPos, LPCTSTR str);
	int iConvert(LPCTSTR lpSami, CStringArray &csaSrts, LPCTSTR lpWriteFolder);
	CSami2Srt();
	virtual ~CSami2Srt();

};
